package com.cmcc.groupcontacts.firewall.dao;

import com.cmcc.groupcontacts.firewall.dao.model.BaseModel;
import com.cmcc.groupcontacts.firewall.dao.model.SmsListVO;

/**
 * 信息拦截记录DAO
 * 
 * @author 
 * 
 */
public class SmsListDAO extends BaseDAO<SmsListVO> {
	public static String TABLE_NAME = "sms_list";

	public SmsListDAO() {
		super(TABLE_NAME);
	}

	@Override
	protected SmsListVO getInstance() {
		return new SmsListVO();
	}

	@Override
	protected String[] getBeanAllCols() {
		return SmsListVO.MetaData.ALL_COLS;
	}

	@Override
	protected void afterGetColValue(BaseModel bean, String colName, String value) {
		SmsListVO smsList = (SmsListVO) bean;
		if (SmsListVO.MetaData.ID.equals(colName))
			smsList.setId(Integer.valueOf(value));
		else if (SmsListVO.MetaData.NUMBER.equals(colName))
			smsList.setNumber(value);
		else if (SmsListVO.MetaData.NAME.equals(colName))
			smsList.setName(value);
		else if (SmsListVO.MetaData.DATE.equals(colName))
			smsList.setDate(Long.valueOf(value));
		else if (SmsListVO.MetaData.TYPE.equals(colName))
			smsList.setType(Integer.valueOf(value));
		else if (SmsListVO.MetaData.PROTOCAL.equals(colName))
			smsList.setProtocal(Integer.valueOf(value));
		else if (SmsListVO.MetaData.SUBJECT.equals(colName))
			smsList.setSubject(value);
		else if (SmsListVO.MetaData.BODY.equals(colName))
			smsList.setBody(value);
		else if (SmsListVO.MetaData.IS_READ.equals(colName))
			smsList.setRead(Boolean.valueOf(value));
	}
}
